fix: use go run for golangci-lint in pre-commit hook#2651
Merged
steveyegge merged 1 commit intosteveyegge:mainfrom Mar 17, 2026
Merged
Conversation
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
2d7a099 to
2fc7074
Compare
Owner
|
Thanks for this comprehensive fix PR @timvisher-dd! Most of the changes here have now been fix-merged to main individually:
The remaining unique change is the pre-commit hook switch from global |
Replace the global golangci-lint binary with `go run` pinned to v2.10.1. This ensures golangci-lint is always compiled with the project's Go toolchain, eliminating version-mismatch panics when the global binary was built with an older Go (e.g., 1.25) than the runtime (e.g., 1.26). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
90dbd59 to
6d1777a
Compare
Contributor
Author
|
@steveyegge Looks like the CI failures are pre-exsiting. Feel free to merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the global
golangci-lintbinary withgo runpinned to v2.10.1 in the pre-commit hook. This ensures golangci-lint is always compiled with the project's Go toolchain, eliminating version-mismatch panics when the global binary was built with an older Go (e.g., 1.25) than the runtime (e.g., 1.26).Also simplifies the hook by removing the
golangci-lintexistence check and fallback logic —go runhandles fetching/caching automatically.Test plan
.gofile change and confirm the pre-commit hook runsgo run golangci-lintsuccessfully without requiring a global install